//
//  ValuationFormulaViewCell.swift
//  AmountBody
//
//  Created by smm on 2018/2/1.
//  Copyright © 2018年 RCMTM. All rights reserved.
//

import UIKit


extension UIColor {
    static let ShenZiColor = UIColor(hexString: "#555555")!
    static let QianZiColor = UIColor(hexString: "#B9B9B9")!
}
@objcMembers
class ValuationFormulaViewCell: UITableViewCell {

    let leftLineView = LeftLineView()
    let titleLabel = UILabel()
    let contentLabel = UILabel()
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        contentView.addSubview(leftLineView);
        contentView.addSubview(titleLabel);
        contentView.addSubview(contentLabel);
        let jianGeW = 20
        let jianGeH = 5
        let labelH = 20
        
        leftLineView .mas_remakeConstraints { (make) in
            make?.left.equalTo()(contentView)?.offset()(CGFloat(jianGeW))
            make?.top.equalTo()(contentView)?.offset()(CGFloat(jianGeH))
        }
        titleLabel.font = UIFont.systemFont(ofSize: 15)
        titleLabel.textColor = UIColor.ShenZiColor
        titleLabel.mas_remakeConstraints { (make) in
            make?.left.equalTo()(contentView)?.offset()(CGFloat(jianGeW))
            make?.right.equalTo()(contentView)?.offset()(CGFloat(-jianGeW))
            make?.top.equalTo()(leftLineView.mas_bottom)?.offset()(CGFloat(jianGeH))
            make?.height.equalTo()(labelH)
            
        }
        contentLabel.font = UIFont.systemFont(ofSize: 13)
        contentLabel.textColor = UIColor.QianZiColor
        contentLabel.mas_remakeConstraints { (make) in
            make?.left.equalTo()(contentView)?.offset()(CGFloat(jianGeW))
            make?.right.equalTo()(contentView)?.offset()(CGFloat(-jianGeW))
            make?.bottom.equalTo()(contentView)?.offset()(CGFloat(-jianGeH*3))
            make?.top.equalTo()(titleLabel.mas_bottom)?.offset()(CGFloat(jianGeH))
        }
     
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    //适配竖屏
    override func layoutSubviews() {
        super.layoutSubviews()
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    var data: Data? {
        didSet {
            leftLineView.titleLabel.text = data?.name
            titleLabel.text = data?.title
            contentLabel.text = data?.content
            
        }
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    
}



////model
//class ValuationFormulaViewModel: NSObject {
//    var name = NSString();
//    var title = NSString();
//    var content = NSString();
//}


